﻿using static System.Console;


Title = "C#实现随机抽取不重复的数组";



List<string> names = new List<string>() { "aa", "bb", "cc", "dd", "ee", "ff", "gg" };

List<string> selectNames = new List<string>();


var temp = Enumerable.Range(0, 10).OrderBy(q => Guid.NewGuid()).Take(5);

temp.ToList().ForEach(q => Console.WriteLine(names[q]);







for (int i = 0; i < 5; i++)
{
    var bytes = Guid.NewGuid().ToByteArray();
    int seed = BitConverter.ToInt32(bytes, 0);
    Random rand = new Random(seed);
    int index = rand.Next(0, names.Count);

    WriteLine(index);

}

selectNames.ForEach(x => Console.WriteLine(x));





ReadKey();